/*
 * @Author: egg1bro
 * @Date: 2023-01-03 17:24:03
 * @LastEditTime: 2023-02-21 14:15:17
 * @LastEditors: egg1bro
 * @Description: 
 * @FilePath: \team-design-backend\routes\admin.js
 * 可以输入预定的版权声明、个性签名、空行等
 */
const express = require('express')

const router = express.Router()
// 引入controller
const { getUserInfo, updateUserName, updateUserDesc, updateUserSex, getSmsByToken, verifySmsToUpdatePhoneByToken
    , verifySmsToResetPasswordPage, resetUserPassword, updateUserPassword,accountCancell } = require('../controller/admin')

const uploadFile = require('../controller/uploadImg')
// 图片上传
let multer = require('multer');
// 文件暂存本地文件夹-自动生成./tmp/
let upload = multer({
    dest: './tmp/'
});

router.post('/upload', upload.single('file'), uploadFile.uploadFile)

router.get('/getUserInfo', getUserInfo)

router.post('/updateUserName', updateUserName)

router.post('/updateUserDesc', updateUserDesc)

router.post('/updateUserSex', updateUserSex)

router.get('/getSmsByToken', getSmsByToken)

router.post('/updatePhone', verifySmsToUpdatePhoneByToken)

router.post('/verifySmsToResetPasswordPage', verifySmsToResetPasswordPage)

router.post('/resetUserPassword', resetUserPassword)

router.post('/updateUserPassword', updateUserPassword)

router.delete('/accountCancell', accountCancell)

module.exports = router
